#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "serialthread.h"
#include "serialthread2.h"
#include "posix_qextserialport.h"
#include <QTimer>
#include <QString>
#include <utils.h>
#include<QtSerialPort/QSerialPort>
#include<QtSerialPort/QSerialPortInfo>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void showMsg(QString str,int type);

private:
    Ui::MainWindow *ui;
    QSerialPort *my_serialport;
    SerialThread *m_Serial_Thread_CardReader;
    SerialThread2 *m_Serial_Thread_CardEmulation;
    int oddEvenVerify(QByteArray temp);
    void sleep(int msec);
    int flag;

private slots:
        void on_pushButton_clicked(); //declare function of push button
        void on_stopBUtton_clicked();
        void on_clearButton_clicked();
        void read_GPRS_Com_CardReader(QByteArray temp);
        void read_GPRS_Com_CardEmulation(QByteArray temp);
        void disconnect_CardReader();
        void disconnect_CardEmulation();
};

#endif // MAINWINDOW_H
